package com.gec.hawaste.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gec.hawaste.entity.SysOffice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gec.hawaste.vo.ExamineDo;
import com.gec.hawaste.vo.SysOfficeDo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 机构表 Mapper 接口
 * </p>
 *
 * @author chenxys
 * @since 2022-07-01
 */
public interface SysOfficeMapper extends BaseMapper<SysOffice> {
    /*@Select("SELECT sys_office.*," +
            " sys_area.`name` areaName," +
            " sys_office.`name` AS parentName" +
            " from sys_office,sys_area" +
            "  WHERE (sys_office.del_flag=0" +
            "         AND sys_office.area_id = sys_area.id" +
            "         AND  sys_office.id in (SELECT sys_office.parent_id FROM sys_office))" +
            "  UNION SELECT sys_office.*," +
            " sys_area.`name` areaName," +
            " sys_office.`name` parentName" +
            " from sys_office,sys_area" +
           " WHERE (sys_office.del_flag=0" +
                   " AND sys_office.area_id = sys_area.id)")
    Page<SysOfficeDo> selectByCondition(IPage<SysOfficeDo> page);*/

    @Select("SELECT sys_office.*," +
            "   sys_area.`name` areaName" +
            "   from sys_office,sys_area" +
            "   WHERE (sys_office.del_flag=0 AND sys_office.area_id = sys_area.id)")
    Page<SysOfficeDo> selectByCondition(IPage<SysOfficeDo> page);
}
